<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Zone')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-zone_id" data-rule="required" data-source="building_zone/index" class="form-control selectpage" name="row[zone_id]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Build_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-build_id" data-rule="required" data-source="building/index" data-field="address" class="form-control selectpage" name="row[build_id]" type="text" value="" placeholder="请先选择区域">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]">
                {foreach name="typeList" item="vo"}
                <option value="{$key}" {in name="key" value="1"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('House_type')}:</label>
        <div id="house-residence" class="col-xs-12 col-sm-8" style="display: none">
            <div style="display: flex; width: 418px">
                <input id="c-house-save-type" name="row[house_save_type]" type="hidden" value="select">
                <input id="c-house_type_name" class="form-control" name="row[house_type_name]" type="text" style="display: none" placeholder="直接输入户型">
                <select id="c-house_type" class="form-control selectpicker" name="row[house_type]" placeholder="请选择户型">
                    {foreach name="houseTypeList" item="vo"}
                    <option value="{$vo.name}">{$vo.name}</option>
                    {/foreach}
                </select>
                <div class="input-group-addon no-border no-padding">
                    <button id="c-house_type-btn" type="button" class="btn btn-primary">添加户型</button>
                </div>
            </div>
        </div>
        <div id="house-not-residence" class="col-xs-12 col-sm-8">
            <div style="display: flex;">
                <div style="display: flex; margin-right: 16px; align-items: center">
                    <span style="width: 60px">卧室:</span>
                    <input id="c-room_num" class="form-control" name="row[room_num]" type="number" value="0">
                </div>
                <div style="display: flex; margin-right: 16px; align-items: center">
                    <span style="width: 60px">客厅:</span>
                    <input id="c-ting_num" class="form-control" name="row[ting_num]" type="number" value="0">
                </div>
                <div style="display: flex; align-items: center">
                    <span style="width: 80px">卫生间:</span>
                    <input id="c-toilet_num" class="form-control" name="row[toilet_num]" type="number" value="0">
                </div>
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Area')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-area" class="form-control" step="0.01" name="row[area]" type="number">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Floor_no')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-floor_no" data-rule="required" class="form-control" name="row[floor_no]" type="number" value="0">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Rent')}:</label>
        <div class="col-xs-12 col-sm-8" style="display: flex">
            <div style="width: 180px">
                <select id="c-payment_type" class="form-control selectpicker" name="row[payment_type]">
                    {foreach name="paymentTypeList" item="vo"}
                    <option value="{$vo}">{$vo}</option>
                    {/foreach}
                </select>
            </div>
            <input id="c-rent" data-rule="required" class="form-control" step="0.01" name="row[rent]" type="number">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">位置:</label>
        <div class="col-xs-12 col-sm-8">
<!--            <input id="c-address" class="form-control" name="row[address]" type="text">-->
            <div class="input-group">
                <input id="c-address" data-rule="required" type="text" class="form-control" size="70" name="row[address]" placeholder="地址" value="">
                <div class="input-group-addon no-border no-padding">
                    <span><button id="c-address-picker" type="button" class="btn btn-primany" data-toggle="addresspicker" data-input-id="c-address"><i class="fa fa-list"></i>选择地址</button></span>
                </div>
                <span class="msg-box n-right" for="c-address"></span>
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">社区:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-community" class="form-control selectpicker" name="row[community]">
                {foreach name="communityList" item="vo"}
                <option value="{$vo.option_id}">{$vo.option_name}</option>
                {/foreach}
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">联系电话:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-mobile" class="form-control" name="row[mobile]" type="tel">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">其他费用:</label>
        <div class="col-xs-12 col-sm-8" style="display: flex; flex-wrap: wrap; justify-content: space-between">
            {foreach $costList as $k => $vo}
            <div style="display: flex; width: 48%; height: 100%; align-items: center">
                <label style="width: 160px">
                    <input type="checkbox" name="row[fixed][{$k}]['checked']" value="{$vo.id}">
                    <span>{$vo.name}</span>
                </label>
                <input id="c-fixed-{$k}" class="form-control" name="row[fixed][{$k}]['price']" step="0.01" type="number">
                <input name="row[fixed][{$k}]['id']" type="hidden" value="{$vo.id}">
                <input name="row[fixed][{$k}]['name']" type="hidden" value="{$vo.name}">
            </div>
            {/foreach}
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">房源标签:</label>
        <div class="col-xs-12 col-sm-8" style="display: flex; flex-wrap: wrap; height: 100%; align-items: center;">
            {foreach $tagList as $k => $vo}
            <label style="margin-right: 12px">
                <input type="checkbox" name="row[tags][{$k}]" value="{$vo.option_id}">
                <span>{$vo.option_name}</span>
            </label>
            {/foreach}
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">房间设施:</label>
        <div class="col-xs-12 col-sm-8" style="display: flex; flex-wrap: wrap; height: 100%; align-items: center;">
            {foreach $peitaoList as $k => $vo}
            <label style="margin-right: 12px">
                <input type="checkbox" name="row[pt][{$k}]['checked']" value="{$vo.option_id}">
                <span>{$vo.option_name}</span>
            </label>
            <input name="row[pt][{$k}]['id']" type="hidden" value="{$vo.option_id}">
            <input name="row[pt][{$k}]['name']" type="hidden" value="{$vo.option_name}">
            {/foreach}
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Images')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-images" class="form-control" size="30" name="row[images]" type="text">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-images" class="btn btn-danger faupload" data-input-id="c-images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-images" class="btn btn-primary fachoose" data-input-id="c-images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-images"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-images"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">封面图片:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-cover" class="form-control" size="50" name="row[cover]" type="text">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-cover" class="btn btn-danger faupload" data-input-id="c-cover" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-preview-id="p-cover"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-cover" class="btn btn-primary fachoose" data-input-id="c-cover" data-mimetype="image/*"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-cover"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-cover"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">视频介绍:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-video" class="form-control" size="50" name="row[video]" type="text">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-video" class="btn btn-danger faupload" data-input-id="c-video" data-mimetype="video/*" data-preview-id="p-video"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-video" class="btn btn-primary fachoose" data-input-id="c-video" data-mimetype="video/*"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-video"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-video"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">房源介绍:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-intro" class="form-control" name="row[intro]" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">入住须知:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-notice" class="form-control" name="row[notice]" type="text">
        </div>
    </div>
<!--    <div class="form-group">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <div class="radio">-->
<!--            {foreach name="statusList" item="vo"}-->
<!--            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="11"}checked{/in} /> {$vo}</label> -->
<!--            {/foreach}-->
<!--            </div>-->
<!--        </div>-->
<!--    </div>-->
<!--    <div class="form-group">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('Price')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-price" class="form-control" step="0.01" name="row[price]" type="number">-->
<!--        </div>-->
<!--    </div>-->
<!--    <div class="form-group">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('Original_price')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-original_price" data-rule="required" class="form-control" step="0.01" name="row[original_price]" type="number" value="0.00">-->
<!--        </div>-->
<!--    </div>-->
<!--    <div class="form-group">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('Remark')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-remark" class="form-control" name="row[remark]" type="text">-->
<!--        </div>-->
<!--    </div>-->
<!--    <div class="form-group">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('Is_remind')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-is_remind" data-rule="required" class="form-control" name="row[is_remind]" type="hidden" value="0">-->
<!--            <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-is_remind" data-yes="1" data-no="0" >-->
<!--            <i class="fa fa-toggle-on text-success fa-flip-horizontal text-gray fa-2x"></i>-->
<!--            </a>-->
<!--        </div>-->
<!--    </div>-->
<!--    <div class="form-group">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('Remind_day')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-remind_day" data-rule="required" class="form-control" name="row[remind_day]" type="number" value="0">-->
<!--        </div>-->
<!--    </div>-->
<!--    <div class="form-group">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('仪表项')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8 yibiaoclass">-->
<!--            -->
<!--            <table class="table fieldlist" data-name="row[yibiaojson]" data-template="row[yibiaojson]tpl">-->
<!--                <tr>-->
<!--                    &lt;!&ndash;类型 *	名称 *	价格 *	最低用量	当前表值	表号	备注&ndash;&gt;-->
<!--                    <td width="80">{:__('类型')}</td>-->
<!--                    <td>{:__('名称')}</td>-->
<!--                    <td>{:__('价格')}</td>-->
<!--                    <td>{:__('最低用量')}</td>-->
<!--                    <td>{:__('当前表值')}</td>-->
<!--                    <td>{:__('表号')}</td> -->
<!--                    <td>{:__('备注')}</td>-->
<!--                    <td width="60">{:__('Operate')}</td>-->
<!--                </tr>-->
<!--                <tr><td colspan="8">-->
<!--                <a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a>-->
<!--                <textarea name="row[yibiaojson]" class="form-control hide" cols="30" rows="5"></textarea>-->
<!--                </td></tr>-->
<!--            </table>-->
<!--            <script type="text/html" id="row[yibiaojson]tpl">-->
<!--                <tr>-->
<!--                    <td width="80">-->
<!--                    <select name="row[yibiaojson][<%=index%>][type]" class="form-control selectpicker">-->
<!--                        <option value="1" <%=row.type == '1' ? 'selected' : ''%>>水表</option>-->
<!--                        <option value="2" <%=row.type == '2' ? 'selected' : ''%>>电表</option>-->
<!--                        <option value="3" <%=row.type == '3' ? 'selected' : ''%>>燃气表</option>-->
<!--                        <option value="4" <%=row.type == '4' ? 'selected' : ''%>>热水表</option>-->
<!--                    </select>-->
<!--                    </td>-->
<!--                    <td>-->
<!--                        <input type="text" name="row[yibiaojson][<%=index%>][name]" class="form-control" value="<%=row.name%>">-->
<!--                    </td>-->
<!--                    <td><input type="text" name="row[yibiaojson][<%=index%>][price]" class="form-control" value="<%=row.price%>"></td>-->
<!--                    <td><input type="text" name="row[yibiaojson][<%=index%>][min_num]" class="form-control" value="<%=row.min_num%>"></td>-->
<!--                    <td><input type="text" name="row[yibiaojson][<%=index%>][last_num]" class="form-control" value="<%=row.last_num%>"></td>-->
<!--                    <td><input type="text" name="row[yibiaojson][<%=index%>][sn]" class="form-control" value="<%=row.sn%>"></td>-->
<!--                    <td><input type="text" name="row[yibiaojson][<%=index%>][remark]" class="form-control" value="<%=row.remark%>"></td>-->
<!--                    <td width="60">-->
<!--                        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>-->
<!--                    </td>-->
<!--                </tr>-->
<!--            </script>-->
<!--            <label class="control-label">{:__('快捷输入')}:</label>-->
<!--            <span class="btn btn-xs btn-info btn-yibiao" data-type="1" data-name="水表">水表</span>-->
<!--            <span class="btn btn-xs btn-info btn-yibiao" data-type="2" data-name="电表">电表</span>-->
<!--            <span class="btn btn-xs btn-info btn-yibiao" data-type="3" data-name="燃气表">燃气表</span>-->
<!--            <span class="btn btn-xs btn-info btn-yibiao" data-type="4" data-name="热水表">热水表</span>-->
<!--        </div>-->
<!--    </div>-->
<!--    <div class="form-group">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('固定项')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8  fixedclass">-->
<!--            -->
<!--            <table class="table fieldlist" data-name="row[fixedjson]" data-template="row[fixedjson]tpl">-->
<!--                <tr>-->
<!--                    &lt;!&ndash;名称 价格 支付类型 先用后收 操作&ndash;&gt;-->
<!--                    <td>{:__('名称')}</td>-->
<!--                    <td>{:__('价格')}</td>-->
<!--                    <td>{:__('支付类型')}</td>-->
<!--                    <td>{:__('先用后收')}</td>-->
<!--                    <td width="60">{:__('Operate')}</td>-->
<!--                </tr>-->
<!--                <tr><td colspan="5">-->
<!--                <a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a>-->
<!--                <textarea name="row[fixedjson]" class="form-control hide" cols="30" rows="5"></textarea>-->
<!--                </td></tr>-->
<!--            </table>-->
<!--            <script type="text/html" id="row[fixedjson]tpl">-->
<!--                <tr>-->
<!--                    <td><input type="text" name="row[fixedjson][<%=index%>][type_name]" class="form-control" value="<%=row.type_name%>"></td>-->
<!--                    <td><input type="text" name="row[fixedjson][<%=index%>][price]" class="form-control" value="<%=row.price%>"></td>-->
<!--                    <td>-->
<!--                    <select name="row[fixedjson][<%=index%>][pay_type]" class="form-control form-select" value="<%=row.pay_type%>">-->
<!--                        <option value="1" <%=row.pay_type == '1' ? 'selected' : ''%>>随房租付</option>-->
<!--                        <option value="2" <%=row.pay_type == '2' ? 'selected' : ''%>>年付</option>-->
<!--                        <option value="3" <%=row.pay_type == '3' ? 'selected' : ''%>>半年付</option>-->
<!--                        <option value="4" <%=row.pay_type == '4' ? 'selected' : ''%>>月付</option>-->
<!--                        <option value="5" <%=row.pay_type == '5' ? 'selected' : ''%>>季付</option>-->
<!--                        <option value="6" <%=row.pay_type == '6' ? 'selected' : ''%>>一次性付</option>-->
<!--                    </select>-->
<!--                    </td>-->
<!--                    <td>-->
<!--                        <input id="c-first_use" type="hidden" name="row[fixedjson][<%=index%>][first_use]" class="form-control" value="0">-->
<!--                        <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-first_use" data-yes="1" data-no="0" >-->
<!--                            <i class="fa fa-toggle-on text-success fa-flip-horizontal text-gray fa-2x"></i>-->
<!--                        </a>-->
<!--                    </td>-->
<!--                    <td width="60">-->
<!--                        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>-->
<!--                    </td>-->
<!--                </tr>-->
<!--            </script>-->
<!--            <label class="control-label">{:__('常用')}:</label>-->
<!--            {foreach name="chargeList" item="vo"}-->
<!--                <span class="btn btn-xs btn-info btn-fixed" data-type_name="{$vo.name}" data-price="{$vo.money}"  data-pay_type="{$vo.pay_type}">{$vo.name}</span>-->
<!--            {/foreach}-->
<!--        </div>-->
<!--        -->
<!--    </div>-->
<!--    <div class="form-group">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('设备项')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8  ptclass">-->
<!--            -->
<!--            <table class="table fieldlist" data-name="row[ptjson]" data-template="row[ptjson]tpl">-->
<!--                <tr>-->
<!--                    &lt;!&ndash;名称 数量 押金 备注 操作&ndash;&gt;-->
<!--                    <td>{:__('名称')}</td>-->
<!--                    <td>{:__('数量')}</td>-->
<!--                    <td>{:__('押金')}</td>-->
<!--                    <td>{:__('备注')}</td>-->
<!--                    <td width="60">{:__('Operate')}</td>-->
<!--                </tr>-->
<!--                <tr><td colspan="5">-->
<!--                <a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a>-->
<!--                <textarea name="row[ptjson]" class="form-control hide" cols="30" rows="5"></textarea>-->
<!--                </td></tr>-->
<!--            </table>-->
<!--            <script type="text/html" id="row[ptjson]tpl">-->
<!--                <tr>-->
<!--                    <td><input type="text" name="row[ptjson][<%=index%>][name]" class="form-control" value="<%=row.name%>"></td>-->
<!--                    <td><input type="text" name="row[ptjson][<%=index%>][num]" class="form-control" value="<%=row.num%>"></td>-->
<!--                    <td><input type="text" name="row[ptjson][<%=index%>][deposit]" class="form-control" value="<%=row.deposit%>"></td>-->
<!--                    <td><input type="text" name="row[ptjson][<%=index%>][remark]" class="form-control" value="<%=row.remark%>"></td>-->
<!--                    <td width="60">-->
<!--                        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>-->
<!--                    </td>-->
<!--                </tr>-->
<!--            </script>-->
<!--            <label class="control-label">{:__('常用')}:</label>-->
<!--            {foreach name="ptList" item="vo"}-->
<!--                <span class="btn btn-xs btn-info btn-pt" data-name="{$vo.name}" data-num="{$vo.num}" data-deposit="{$vo.deposit}" data-remark="{$vo.remark}">{$vo.name}</span>-->
<!--            {/foreach}-->
<!--        </div>-->
<!--    </div>-->
    
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
